package com.holy.sh.module_base_mvp.constants.api;




import com.holy.sh.module_base_mvp.constants.ConstantsApi;

import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by victor on ${DATA}
 * Email : victorhhl@163.com
 */
public class HolyRetrofit {
    private Retrofit retrofit;

    public HolyRetrofit(OkHttpClient okHttpClient) {
        retrofit = new Retrofit.Builder().client(okHttpClient)
                .baseUrl(ConstantsApi.BASE_URL)
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .addConverterFactory(GsonConverterFactory.create()).build();
    }

    public Retrofit getRetrofit() {
        return retrofit;
    }
}
